<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="../include/js/jq.js"></script>
        <link rel="stylesheet" href="<{$config.SITE_URL}>/images/admin/style.css"/>
        <style>
            table tr td{
                border-bottom: 1px #eeeeee solid;
            }
        </style>
        <script>
            $(function(){
                var i=0;
                $("#addnew").click(function(){
                    $(this).parents("tr").before('<tr><td></td><td><input type="hidden" name="newid['+i+']" value="0"/></td><td><input type="text" name="newsrc['+i+']" /></td><td><input type="text" name="newhref['+i+']" /></td><td><input type="text" name="newdes['+i+']" value="无"/></td><td></td></tr>');
                    i++;
                });
                $("#chkall").click(function(){
                    var chkall=$(this).attr("checked");
                    $("input[name='chk[]']").each(function(){
                        if(chkall){
                            $(this).attr("checked",true);
                        }else{
                            $(this).attr("checked",false);
                        }
                        
                    });
                });
                interval1=setInterval(function(){$("#nowtime").text(getnowtime())},1000);
                
            })
            function getnowtime(){
                var nowtime=Date.parse(new Date())/1000;
                return nowtime;
            }
            function stop(obj){
                if(obj.value=="stop"){
                    clearInterval(interval1);
                    obj.value="start";
                }else{
                    interval1=setInterval(function(){$("#nowtime").text(getnowtime())},1000);
                    obj.value="stop";
                }
            }
        </script>
    </head>
    <body>
        <div class="main">
            <form method="post">
            <table border="0" cellpadding="0" cellspacing="0" style="width:710px;">
                    <tr>
                        <td width="5%"><input type="checkbox" id="chkall"/>删除</td>
                        <td width="5%">id</td>
                        <td>图片链接</td>
                        <td>目标链接</td>
                        <td>描述</td>
                        <td>更新时间</td>
                    </tr>
                    
                
                    
                    <{section name=i loop=$list}>
                    <tr>
                        <td><input type="checkbox" name="chk[]" value="<{$list[i].id}>"/></td>
                        <td><{$list[i].id}><input type="hidden" name="id[]" value="<{$list[i].id}>"/></td>
                        <td><input type="text" name="src[<{$list[i].id}>]" value="<{$list[i].src}>"/></td>
                        <td><input type="text" name="href[<{$list[i].id}>]" value="<{$list[i].href}>"/></td>
                        <td><input type="text" name="des[<{$list[i].id}>]" value="<{$list[i].des}>"/></td>
                        <td><input type="text" name="time[<{$list[i].id}>]" value="<{$list[i].time}>"/></td>
                    </tr>
                    <{/section}>
                
                
                    <tr><td><input type="button" value='+增加行' id="addnew"/></td> <td colspan="2">  当前时间戳：<span id="nowtime"><{$smarty.now}></span> <input type="button" value="stop" onclick="stop(this)"/></td></tr>
                <tr><td><input type="submit" name="submit" value="保存"/></td></tr>
            </table>  
            </form>
        </div>
    </body>
</html>
